<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8">
  <title>deploy.pp</title>
  <link rel="stylesheet" href="http://jashkenas.github.com/docco/resources/docco.css">
</head>
<body>
<div id='container'>
  <div id="background"></div>
  <div id="jump_to">
    Jump To &hellip;
    <div id="jump_wrapper">
      <div id="jump_page">
          <a class="source" href="deploy.html">deploy.pp</a>
          <a class="source" href="extract.html">extract.pp</a>
          <a class="source" href="file.html">file.pp</a>
          <a class="source" href="init.html">init.pp</a>
      </div>
    </div>
  </div>
  <table cellspacing=0 cellpadding=0>
  <thead>
    <tr>
      <th class=docs><h1>deploy.pp</h1></th>
      <th class=code></th>
    </tr>
  </thead>
  <tbody>
    <tr id='section-Define:_staging::deploy'>
      <td class=docs>
        <div class="pilwrap">
          <a class="pilcrow" href="#section-Define:_staging::deploy">&#182;</a>
        </div>
        <h3>Define: staging::deploy</h3>

<p>The define resource extracts compressed file to a staging location.</p>

<h3>Parameters:</h3>

<ul>
<li>[<em>source</em>]:  the source file location, supports local files, puppet://, http://, https://, ftp:// (default: )</li>
<li>[<em>target</em>]:  the target extraction directory (default: )</li>
<li>[<em>staging_path</em>]:  the staging location for compressed file. defaults to ${staging::path}/${caller_module_name} (default: undef)</li>
<li>[<em>username</em>]:  https or ftp username (default: undef)</li>
<li>[<em>certificate</em>]:  https certifcate file (default: undef)</li>
<li>[<em>password</em>]:  https or ftp user password or https certificate password (default: undef)</li>
<li>[<em>environment</em>]:  environment variable for settings such as http_proxy (default: undef)</li>
<li>[<em>timeout</em>]:  the time to wait for the file transfer to complete (default: undef)</li>
<li>[<em>user</em>]:  extract file as this user (default: undef)</li>
<li>[<em>group</em>]:  extract group as this group (default: undef)</li>
<li>[<em>creates</em>]:  the file/folder created after extraction. if unspecified defaults to ${target}/${name} (default: undef)</li>
<li>[<em>unless</em>]:  alternative way to conditionally extract file (default: undef)</li>
<li>[<em>onlyif</em>]:  alternative way to conditionally extract file (default: undef)</li>
</ul>


<h3>Usage:</h3>

<pre><code>staging::deploy { 'sample.tar.gz':
  source =&gt; 'puppet:///modules/staging/sample.tar.gz',
  target =&gt; '/usr/local',
}
</code></pre>

      </td>
      <td class=code>
        <div class='highlight'><pre><span class="n">define</span> <span class="n">staging</span><span class="o">::</span><span class="n">deploy</span> <span class="p">(</span>
  <span class="vg">$source</span><span class="p">,</span>               
  <span class="vg">$target</span><span class="p">,</span>               
  <span class="vg">$staging_path</span> <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$username</span>     <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$certificate</span>  <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$password</span>     <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$environment</span>  <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$timeout</span>      <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$user</span>         <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$group</span>        <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$creates</span>      <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$unless</span>       <span class="o">=</span> <span class="k">undef</span><span class="p">,</span> 
  <span class="vg">$onlyif</span>       <span class="o">=</span> <span class="k">undef</span>  
<span class="p">)</span> <span class="p">{</span>

  <span class="n">staging</span><span class="o">::</span><span class="n">file</span> <span class="p">{</span> <span class="vg">$name</span><span class="p">:</span>
    <span class="n">source</span>      <span class="o">=&gt;</span> <span class="vg">$source</span><span class="p">,</span>
    <span class="n">target</span>      <span class="o">=&gt;</span> <span class="vg">$staging_path</span><span class="p">,</span>
    <span class="n">username</span>    <span class="o">=&gt;</span> <span class="vg">$username</span><span class="p">,</span>
    <span class="n">certificate</span> <span class="o">=&gt;</span> <span class="vg">$certificate</span><span class="p">,</span>
    <span class="n">password</span>    <span class="o">=&gt;</span> <span class="vg">$password</span><span class="p">,</span>
    <span class="n">environment</span> <span class="o">=&gt;</span> <span class="vg">$environment</span><span class="p">,</span>
    <span class="n">subdir</span>      <span class="o">=&gt;</span> <span class="vg">$caller_module_name</span><span class="p">,</span>
    <span class="n">timeout</span>     <span class="o">=&gt;</span> <span class="vg">$timeout</span><span class="p">,</span>
  <span class="p">}</span>

  <span class="n">staging</span><span class="o">::</span><span class="n">extract</span> <span class="p">{</span> <span class="vg">$name</span><span class="p">:</span>
    <span class="n">target</span>      <span class="o">=&gt;</span> <span class="vg">$target</span><span class="p">,</span>
    <span class="n">source</span>      <span class="o">=&gt;</span> <span class="vg">$staging_path</span><span class="p">,</span>
    <span class="n">user</span>        <span class="o">=&gt;</span> <span class="vg">$user</span><span class="p">,</span>
    <span class="n">group</span>       <span class="o">=&gt;</span> <span class="vg">$group</span><span class="p">,</span>
    <span class="n">environment</span> <span class="o">=&gt;</span> <span class="vg">$environment</span><span class="p">,</span>
    <span class="n">subdir</span>      <span class="o">=&gt;</span> <span class="vg">$caller_module_name</span><span class="p">,</span>
    <span class="n">creates</span>     <span class="o">=&gt;</span> <span class="vg">$creates</span><span class="p">,</span>
    <span class="k">unless</span>      <span class="o">=&gt;</span> <span class="vg">$unless</span><span class="p">,</span>
    <span class="n">onlyif</span>      <span class="o">=&gt;</span> <span class="vg">$onlyif</span><span class="p">,</span>
    <span class="nb">require</span>     <span class="o">=&gt;</span> <span class="no">Staging</span><span class="o">::</span><span class="no">File</span><span class="o">[</span><span class="vg">$name</span><span class="o">]</span><span class="p">,</span>
  <span class="p">}</span>

<span class="p">}</span></pre></div>
      </td>
    </tr>
  </table>
</div>
</body>
